<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2022/11/29
  Time: 16:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="bean.ItemBean" %>
<%@ page import="bean.Item" %>
<jsp:useBean id="itemBean" class="bean.ItemBean" scope="application"/>
<style>
    #tom{
        font-family:宋体;font-size:20;
    }
</style>
<style>
    body {
        background: url(../image/sport.png) no-repeat center center fixed;
        /*兼容浏览器版本*/
        -webkit-background-size: cover;
        -o-background-size: cover;
        background-size: cover;
    }
</style>
<html>
<body id="tom">
<center>
    <h1>欢迎来到河南工业大学运动会管理系统！</h1>
    <table border="1">
        <tr>
            <th width="30">编号</th>
            <th width="30">名称</th>
            <th width="30">类别</th>
            <th width="150">比赛规则</th>
            <th width="100">地点</th>
            <th width="100">时间</th>
        </tr>
        <%
            itemBean=(ItemBean) application.getAttribute("itemBean");
            itemBean.link();
            itemBean.getItemArrayList().clear();
            itemBean.loadItem();

            for(Item i:itemBean.getItemArrayList()){
                out.println("<tr class='test-c'>");
                out.println("<td>"+i.getId()+"</td>");
                out.println("<td>"+i.getName()+"</td>");
                out.println("<td>"+i.getSex()+"</td>");
                out.println("<td>"+i.getRules()+"</td>");
                out.println("<td>"+i.getPlace()+"</td>");
                out.println("<td>"+i.getTime()+"</td>");
                out.println("</tr>");
            }
        %>
    </table>
    <form action="VolApplyServlet" method="post">
        请输入要报名的编号:<input type="text" size="10" name="id"/><br>
        <br><input type="submit" name="submit" value="报名">
    </form>
    <%
        String info = (String) session.getAttribute("volInfo");
        if (info != null){
            out.print(info);
        }
    %>
    <a href="vol_index.jsp">返回</a>
</center>
</body>
</html>
